import { getGameObjectById } from "../engine";
import { Behaviour } from "../engine/Behaviour";
import { Transform } from "../engine/Transform";
import { number } from "../engine/validators/number";
import { RigidBody } from "./RigidBody";

export class StayStillWalk extends Behaviour {

    onStart() {


    }

    onTick(duringTime: number) {

        const Alice=getGameObjectById("Alice")
        const AliceTransform=Alice.getBehaviour(Transform)
        const transform = this.gameObject.getBehaviour(Transform);
        // if(this.gameObject.id==="camera"){
        //     transform.x=AliceTransform.x;
        // }
        if(this.gameObject.children[0].id==="stop"){
            transform.x=AliceTransform.x-300;
        }
        else if(this.gameObject.children[0].id==="heart1"){
            transform.x=AliceTransform.x+200;
        }
        else if(this.gameObject.children[0].id==="heart2"){
            transform.x=AliceTransform.x+260;
        }
        else if(this.gameObject.children[0].id==="heart3"){
            transform.x=AliceTransform.x+320;
        }
        // else if(this.gameObject.children[0].id==="Monster"){
        //     transform.x=AliceTransform.x-250;
        // }

    }
}
